package com.honey.mybatis.generator.dao.method;

import com.honey.compilation.java.JavaKeyWord;
import com.honey.compilation.java.JavaVisibility;
import com.honey.compilation.java.MethodDecoration;
import com.honey.core.types.FullyQualifiedJavaType;
import com.honey.core.types.JDKFullyQualifiedJavaType;
import com.honey.mybatis.generator.AbstractMethod;
import com.honey.mybatis.generator.dao.DaoConstant;

/**
 * 按照primaryKey查询
 * @author Administrator
 *
 */
public class GetNameSpaceMethod extends AbstractMethod{
	
	private static final String METHOD_NAME="getNameSpace";
	
	private static final FullyQualifiedJavaType RETURN_TYPE = JDKFullyQualifiedJavaType.getStringInstance();

	private static final String[] BODY=new String[]{
		JavaKeyWord.RETURN + DaoConstant.MAPPER_NAME_SPACE_FIELD_NAME 
	};
	
	
	private static final String[] JAVA_DOC=new String[]{
		"获取映射文件的命名空间。" 
	};
	
	private static final String[] ANNOTATION=new String[]{
		"Override" 
	};
	
	
	@Override
	protected String getMethodName() {
		return METHOD_NAME;
	}
	
	/* (non-Javadoc)
	 * @see com.honey.mybatis.generator.AbstractMethod#getReturnType()
	 */
	@Override
	protected FullyQualifiedJavaType getReturnType() {
		
		return RETURN_TYPE;
	}

	/* (non-Javadoc)
	 * @see com.honey.mybatis.generator.AbstractMethod#getBody()
	 */
	@Override
	protected String[] getBody() {
		
		return BODY;
	}

	/* (non-Javadoc)
	 * @see com.honey.mybatis.generator.AbstractMethod#getJavaDoc()
	 */
	@Override
	protected String[] getJavaDoc() {
		return JAVA_DOC;
	}

	/* (non-Javadoc)
	 * @see com.honey.mybatis.generator.AbstractMethod#getMethodDecoration()
	 */
	@Override
	protected MethodDecoration getMethodDecoration() {
		MethodDecoration answer = super.getMethodDecoration();
		answer.setVisibility(JavaVisibility.PROTECTED);
		answer.setFinal(true);
		return answer;
	}

	/* (non-Javadoc)
	 * @see com.honey.mybatis.generator.AbstractMethod#getAnnotation()
	 */
	@Override
	protected String[] getAnnotation() {
		return ANNOTATION;
	}
	
	
	
}
